//
//  WlContractModel.swift
//
//  Created by 邱仙凯 on 2021/6/11
//  Copyright (c) . All rights reserved.
//

import Foundation
import ObjectMapper

public struct ZyaWlContractModel: Mappable {

  // MARK: Declaration for string constants to be used to decode and also serialize.
  private struct SerializationKeys {
    static let zOrgNm = "z_org_nm"
    static let idKey = "id_key"
    static let zSupplierNm = "z_supplier_nm"
    static let zType = "z_type"
    static let zOrgId = "z_org_id"
    static let zSupplierId = "z_supplier_id"
    static let rn = "rn"
    static let zHtNo = "z_ht_no"
      static let zAccountPeriod = "z_account_period"
  }

  // MARK: Properties
  public var zOrgNm: String?
  public var idKey: Int?
  public var zSupplierNm: String?
  public var zType: String?
  public var zOrgId: Int?
  public var zSupplierId: Int?
  public var rn: Int?
  public var zHtNo: String?
    public var zAccountPeriod: Int?

  // MARK: ObjectMapper Initializers
  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public init?(map: Map){

  }

  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public mutating func mapping(map: Map) {
    zOrgNm <- map[SerializationKeys.zOrgNm]
    idKey <- map[SerializationKeys.idKey]
    zSupplierNm <- map[SerializationKeys.zSupplierNm]
    zType <- map[SerializationKeys.zType]
    zOrgId <- map[SerializationKeys.zOrgId]
    zSupplierId <- map[SerializationKeys.zSupplierId]
    rn <- map[SerializationKeys.rn]
    zHtNo <- map[SerializationKeys.zHtNo]
      zAccountPeriod <- map[SerializationKeys.zAccountPeriod]
  }

  /// Generates description of the object in the form of a NSDictionary.
  ///
  /// - returns: A Key value pair containing all valid values in the object.
  public func dictionaryRepresentation() -> [String: Any] {
    var dictionary: [String: Any] = [:]
    if let value = zOrgNm { dictionary[SerializationKeys.zOrgNm] = value }
    if let value = idKey { dictionary[SerializationKeys.idKey] = value }
    if let value = zSupplierNm { dictionary[SerializationKeys.zSupplierNm] = value }
    if let value = zType { dictionary[SerializationKeys.zType] = value }
    if let value = zOrgId { dictionary[SerializationKeys.zOrgId] = value }
    if let value = zSupplierId { dictionary[SerializationKeys.zSupplierId] = value }
    if let value = rn { dictionary[SerializationKeys.rn] = value }
    if let value = zHtNo { dictionary[SerializationKeys.zHtNo] = value }
      if let value = zAccountPeriod { dictionary[SerializationKeys.zAccountPeriod] = value }
    return dictionary
  }

}
